package files;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Rename {
    public static void main(String[] args) {
        String path="J:\\photos";
        File file = new File(path);
        for (File file1 : file.listFiles()) {
            String str=file1.getName();
            boolean a=file1.renameTo(new File(path+"\\"+Integer.valueOf(str.substring(0,6))+".png"));
            System.out.println(a);
        }
    }
}
